import request from '@/utils/request'

// 查询配置
export function getConfigInfo(configName,commandId) {
  return request({
    url: '/pms/table/getConfigInfo/' + configName+'/'+commandId,
    method: 'get',
  })
}
// 查询列表
export function getDataList(route,query) {
  return request({
    url: route+'/list',
    method: 'get',
    params: query
  })
}

// 查询详细
export function getData(route,id) {
  return request({
    url: route+'/' + id,
    method: 'get'
  })
}

// 查询Command
export function getCommandData(route,query='') {
  return request({
    url: route,
    method: 'get',
    params: query
  })
}

// 新增
export function addData(route,data) {
  return request({
    url: route+'',
    method: 'post',
    data: data
  })
}

// 修改
export function updateData(route,data) {
  return request({
    url: route+'',
    method: 'put',
    data: data
  })
}

// 删除
export function delData(route,id) {
  return request({
    url: route+'/' + id,
    method: 'delete'
  })
}

// 导出
export function exportData(route,query) {
  return request({
    url: route+'/export',
    method: 'get',
    params: query
  })
}

// 查询table表单详细
export function getColumnList(route,id) {
  return request({
    url: route+'/list/'+id,
    method: 'get',
  })
}

// 查询table表单详细
export function getColumnLists(route,query) {
  return request({
    url: route+'/list',
    method: 'get',
    params: query
  })
}

// 查询table列详细
export function getColumnData(route,Id,query) {
  return request({
    url: route+'/' + Id,
    method: 'get',
    params: query
  })
}

//添加Command命令
export function addCommand(data) {
  return request({
    url: '/pms/subcommand',
    method: 'post',
    data:data
  })
}

// 新增table列
export function addColumn(route,data) {
  return request({
    url: route,
    method: 'post',
    data: data
  })
}

// 修改table列
export function updateColumn(route,data) {
  return request({
    url: route,
    method: 'put',
    data: data
  })
}

// 删除table列
export function delColumn(route,Id) {
  return request({
    url: route+'/' + Id,
    method: 'delete'
  })
}

